<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class EstateRole extends Model
{

    protected $table = 'estate_roles';

    protected $fillable = ['name', 'estate_id'];

//    protected $guarded = [];

    public function permissions()
    {
        return $this->belongsToMany('App\Models\EstatePermission', 'estate_role_permissions', 'role_id', 'permission_id');
    }

    public function menus()
    {
        return $this->belongsToMany('App\Models\EstateMenu', 'estate_role_menus', 'role_id', 'menu_id');
    }
}
